package com.risk.kernel.service.impl;

import com.risk.common.core.domain.AjaxResult;
import com.risk.common.utils.DateUtils;
import com.risk.kernel.domain.TkTaskCase;
import com.risk.kernel.mapper.TkTaskCaseMapper;
import com.risk.kernel.service.TkTaskCaseServiceI;
import com.risk.kernel.utils.RandomUtil;
import com.risk.kernel.vo.TkTaskCaseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: Liwen
 * @createTime: 2025/1/7
 * @description:
 */
@Service
public class TkTaskCaseServiceImpl implements TkTaskCaseServiceI {
    @Autowired
    private TkTaskCaseMapper tkTaskCaseMapper;

    /**
     * 查询
     *
     * @param id 主键
     * @return
     */
    @Override
    public TkTaskCase selectTkTaskCaseById(String id) {
        return tkTaskCaseMapper.selectTkTaskCaseById(id);
    }

    /**
     * 查询列表
     *
     * @param
     * @return
     */
    @Override
    public List<TkTaskCaseVo> selectTkTaskCaseList(String keys) {
        return tkTaskCaseMapper.selectTkTaskCaseList(keys);
    }

    /**
     * 新增
     *
     * @param tkTaskCase
     * @return 结果
     */
    @Override
    public int insertTkTaskCase(TkTaskCase tkTaskCase) {
        tkTaskCase.setId(RandomUtil.getRandomNumber());
        tkTaskCase.setCreateTime(DateUtils.getNowDate());
        return tkTaskCaseMapper.insertTkTaskCase(tkTaskCase);
    }

    /**
     * 修改
     *
     * @param tkTaskCase
     * @return 结果
     */
    @Override
    public int updateTkTaskCase(TkTaskCase tkTaskCase) {
        tkTaskCase.setUpdateTime(DateUtils.getNowDate());
        return tkTaskCaseMapper.updateTkTaskCase(tkTaskCase);
    }

    /**
     * 批量删除
     *
     * @param ids 需要删除的主键
     * @return 结果
     */
    @Override
    public int deleteTkTaskCaseByIds(String[] ids) {
        return tkTaskCaseMapper.deleteTkTaskCaseByIds(ids);
    }

    /**
     * 删除
     *
     * @param id 主键
     * @return 结果
     */
    @Override
    public int deleteTkTaskCaseById(String id) {
        return tkTaskCaseMapper.deleteTkTaskCaseById(id);
    }


}
